import javax.microedition.lcdui.List;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;

public class TMainMenu extends List implements CommandListener {
	protected CommandListener mParent;
	public Command browseCommand;
	public Command localCommand;
		
	public TMainMenu(CommandListener parentApp) {
		super("Чем Зайемся?", List.IMPLICIT);
		mParent = parentApp;
		append("Поищим файл", null);
		append("Локальные данные", null);
		setCommandListener(this);
	}

  public void commandAction(Command c, Displayable d) {
		if(c == List.SELECT_COMMAND) {
			if(getSelectedIndex()==0) mParent.commandAction(browseCommand, d);
			else if(getSelectedIndex()==1) mParent.commandAction(localCommand, d);
		} else mParent.commandAction(c, d);
	}

}		